package com.github.slprj.slake.log;

import org.slf4j.Logger;

/**
 * Des:
 * Slf4j 日志实现类
 *
 * @author captain
 * @date 2022/8/19 15:41
 */
public class Slf4jLog implements SlLog {
    private final Logger log;

    public Slf4jLog(Logger log) {
        this.log = log;
    }

    @Override
    public boolean isDebugEnabled() {
        return log.isDebugEnabled();
    }

    @Override
    public void debug(String message) {
        if (isDebugEnabled()) {
            log.debug(message);
        }
    }

    @Override
    public void debug(String format, Object arg) {
        if (isDebugEnabled()) {
            log.debug(format, arg);
        }
    }

    @Override
    public void debug(String format, Object arg1, Object arg2) {
        if (isDebugEnabled()) {
            log.debug(format, arg1, arg2);
        }
    }

    @Override
    public void debug(String format, Object... args) {
        if (isDebugEnabled()) {
            log.debug(format, args);
        }
    }

    @Override
    public void debug(String message, Throwable throwable) {
        if (isDebugEnabled()) {
            log.debug(message, throwable);
        }
    }

    @Override
    public boolean isInfoEnabled() {
        return log.isInfoEnabled();
    }

    @Override
    public void info(String message) {
        if (isInfoEnabled()) {
            log.info(message);
        }
    }

    @Override
    public void info(String format, Object arg) {
        if (isInfoEnabled()) {
            log.info(format, arg);
        }
    }

    @Override
    public void info(String format, Object arg1, Object arg2) {
        if (isInfoEnabled()) {
            log.info(format, arg1, arg2);
        }
    }

    @Override
    public void info(String format, Object... args) {
        if (isInfoEnabled()) {
            log.info(format, args);
        }
    }

    @Override
    public void info(String message, Throwable throwable) {
        if (isInfoEnabled()) {
            log.info(message, throwable);
        }
    }

    @Override
    public boolean isWarnEnabled() {
        return log.isWarnEnabled();
    }

    @Override
    public void warn(String message) {
        log.warn(message);
    }

    @Override
    public void warn(String format, Object arg) {
        if (isInfoEnabled()) {
            log.warn(format, arg);
        }
    }

    @Override
    public void warn(String format, Object arg1, Object arg2) {
        if (isInfoEnabled()) {
            log.warn(format, arg1, arg2);
        }
    }

    @Override
    public void warn(String format, Object... args) {
        if (isInfoEnabled()) {
            log.warn(format, args);
        }
    }

    @Override
    public void warn(String message, Throwable throwable) {
        if (isInfoEnabled()) {
            log.warn(message, throwable);
        }
    }

    @Override
    public boolean isErrorEnabled() {
        return log.isErrorEnabled();
    }

    @Override
    public void error(String message) {
        log.error(message);
    }

    @Override
    public void error(String format, Object arg) {
        log.error(format, arg);
    }

    @Override
    public void error(String format, Object arg1, Object arg2) {
        log.error(format, arg1, arg2);
    }

    @Override
    public void error(String format, Object... args) {
        log.error(format, args);
    }

    @Override
    public void error(String message, Throwable throwable) {
        log.error(message, throwable);
    }
}
